<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: admin
  Date: 2022/2/27
  Time: 19:22
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/css/head.css">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/css/product_img.css">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/css/travel_details.css">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/css/Carousel figure.css">
    <!-- 新 Bootstrap 核心 CSS 文件 -->
    <%--<link href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">--%>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/css/bootstrap.css">

    <script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery-3.6.0.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery-easyui-1.5.2/jquery.easyui.min.js"></script>


    <script type="text/javascript">





                $(document).ready(function(){
//获得文本框对象
            var t = $("#text_box01");
//初始化数量为1,并失效减
            $("#minus01").attr("disabled",true);
            //数量增加操作
            $("#add01").click(function(){
                // 给获取的val加上绝对值，避免出现负数
                t.val(Math.abs(parseInt(t.val()))+1);
                if (parseInt(t.val())!=1){
                    $("#minus01").attr("disabled",false);
                }


                     $("span[id='c_price']").html(Math.abs(parseInt(t.val()))*$("input[id='one_cprice']").val())
                $("span[id='all_price']").html(Math.abs(parseInt(t.val()))*$("input[id='one_cprice']").val()+Math.abs(parseInt($("#text_box02").val()))*$("input[id='one_aprice']").val())



               // alert(Math.abs(parseInt(t.val()))*$("input[id='one_cprice']").val())
               //  alert(Math.abs(parseInt($("#text_box02").val()))*$("input[id='one_aprice']").val())


            })
            //数量减少操作
            $("#minus01").click(function(){
                t.val(Math.abs(parseInt(t.val()))-1);
                if (parseInt(t.val())==1){
                    $("#minus01").attr("disabled",true);
                }
                $("span[id='c_price']").html(Math.abs(parseInt(t.val()))*$("input[id='one_cprice']").val())
                $("span[id='all_price']").html(Math.abs(parseInt(t.val()))*$("input[id='one_cprice']").val()+Math.abs(parseInt($("#text_box02").val()))*$("input[id='one_aprice']").val())

            })

        });











                    $(document).ready(function(){
//获得文本框对象
            var t = $("#text_box02");
//初始化数量为1,并失效减
            $("#minus02").attr("disabled",true);
            //数量增加操作
            $("#add02").click(function(){
                // 给获取的val加上绝对值，避免出现负数
                t.val(Math.abs(parseInt(t.val()))+1);
                if (parseInt(t.val())!=1){
                    $("#minus02").attr("disabled",false);
                }

                $("span[id='a_price']").html(Math.abs(parseInt(t.val()))*$("input[id='one_aprice']").val())
                $("span[id='all_price']").html(Math.abs(parseInt(t.val()))*$("input[id='one_aprice']").val()+Math.abs(parseInt($("#text_box01").val()))*$("input[id='one_cprice']").val())

            })
            //数量减少操作
            $("#minus02").click(function(){
                t.val(Math.abs(parseInt(t.val()))-1);
                if (parseInt(t.val())==1){
                    $("#minus02").attr("disabled",true);
                }

                $("span[id='a_price']").html(Math.abs(parseInt(t.val()))*$("input[id='one_aprice']").val())
                $("span[id='all_price']").html(Math.abs(parseInt(t.val()))*$("input[id='one_aprice']").val()+Math.abs(parseInt($("#text_box01").val()))*$("input[id='one_cprice']").val())
            })



                        var buy=$("a[id='buy']")
                        buy.bind("click",function () {

                        var url="${pageContext.request.contextPath}/font/buy1";
                        var cn=$("input[id='text_box01']").val();
                        var an=$("input[id='text_box02']").val();
                        var pcode=$("input[id='productcode']").val();
                        var allprice=$("span[id='all_price']").text();
                        var ordername=$("span[id='productname']").text()
                        var usercode=$("span[id='usercode']").text()
                        var args={'Child_number':cn,'Adult_number':an,'total_price':allprice,'ordername':ordername,'usercode':usercode,'productcode':pcode}
                        $.post(url,args)



                        })





        });














    </script>


</head>
<body>
<header class="a">
    <div class="a2"><img src="${pageContext.request.contextPath }/images/travel/iphone.png" style="width: 100%;height: 100%;object-fit:cover"></div>
    <div class="a2"><img src="${pageContext.request.contextPath }/images/travel/wechat.png" style="width: 100%;height: 100%;object-fit:cover"></div>


    <c:if test="${users.name==null}">
        <div class="a1">
            <a href="${pageContext.request.contextPath}/skip/skipUserLogin" style="text-decoration: none;">请用户登录！</a>
        </div>
        <div class="a1">
            <a href="${pageContext.request.contextPath}/skip/skipUsersLogin" style="text-decoration: none;">商家登录</a>
        </div>
        <div class="a1">
            <a href="${pageContext.request.contextPath}/skip/register" style="text-decoration: none;">商家注册</a>
        </div>
    </c:if>




    <c:if test="${users.name!=null}">
        <div class="a1">
            <a href="${pageContext.request.contextPath}/user/loginOut" style="text-decoration: none;">退出</a>
        </div>
        <div class="a1">
            <a href="${pageContext.request.contextPath }/font/usersOrder" style="text-decoration: none;">我的订单</a>
        </div>
        <div class="a1">
            <a href="${pageContext.request.contextPath}/skip/skipUsersLogin" style="text-decoration: none;">商家登录</a>
        </div>
        <div class="a1">
            <a href="${pageContext.request.contextPath}/skip/register" style="text-decoration: none;">商家注册</a>
        </div>
        <div class="a1" style="width: 200px;    line-height: 30px;">
            <p>
                <span>您好！</span>
                <span style="color: #000000">${users.name}</span>
                , 欢迎你！

            </p>
        </div>
    </c:if>



</header>
<div class="b">
    <div class="b1"><img src="${pageContext.request.contextPath }/images/travel/22.JPG" style="width: 100%;height: 100%;object-fit:cover"></div>

    <div class="col-md-8 colum">
        <form class="form-inline" action="${pageContext.request.contextPath}/font/select" method="post" style="float: right">
            <input type="text" name="keyWord" class="form-control" style="width:500px;margin-top: 6%;margin-left: -45%;" placeholder="${null}">
            <input type="submit" value="查询" class="btn btn-primary" style="margin-top: 6%;">
        </form>
    </div>

    <div class="b2"><img src="${pageContext.request.contextPath }/images/travel/phone.JPG" style="width: 100%;height: 100%;object-fit:cover"></div>
</div>
<div class="c">

    <div class="c1" ><a href="${pageContext.request.contextPath}/home page.jsp">首页</a></div>
    <div class="c1"><a href="${pageContext.request.contextPath}/font/travel?priductaddress=北京&priductaddress01=成都&priductaddress02=福州&priductaddress03=西藏">畅行旅游</a></div>
    <div class="c1"><a href="${pageContext.request.contextPath}/font/travel_team?number01=6&number02=8&number03=10&number04=12">团购旅游</a></div>
    <div class="c1"><a href=""></a></div>
    <div class="c1"><a href=""></a></div>

</div>

<div class="produce_details">

    <div class="produce_img">

        <div id="box">
            <!-- 相框 -->
            <div id="xiangkuang">
                <ul id="ulobj">
                    <li><a href=""><img src="${pageContext.request.contextPath}/${product.productimg1}" alt="" style="height: 400px"></a></li>
                    <li><a href=""><img src="${pageContext.request.contextPath}/${product.productimg2}" alt="" style="height: 400px"></a></li>
                    <li><a href=""><img src="${pageContext.request.contextPath}/${product.productimg3}" alt="" style="height: 400px"></a></li>
                    <li><a href=""><img src="${pageContext.request.contextPath}/${product.productimg4}" alt="" style="height: 400px"></a></li>
                    <li><a href=""><img src="${pageContext.request.contextPath}/${product.productimg5}" alt="" style="height: 400px"></a></li>
                </ul>
            </div>
            <!-- 圆点 -->
            <ol id="olobj">
                <li class="bjys"></li>
                <li></li>
                <li></li>
                <li></li>
                <li></li>
            </ol>
            <!-- 左右按钮 -->
            <div id="anniu">
                <span id="left"> < </span>
                <span id="right"> > </span>
            </div>
        </div>
    </div>


    <div class="produce_details_name">
        <span style="font-size: 25px" id="productname">${product.productname}</span>
    </div>
    <div class="produce_details_detail">
        <span style="font-size: 15px">旅游详情：${product.productdetil}</span>
    </div>
    <input id="productcode" type="hidden" value="${product.productcode}">
    <div class="travel_time_1"><span style="font-size: 20px;line-height:40px;">${product.producttime}</span></div>
    <div class="travel_time_2"><span style="font-size: 20px;line-height:40px;">出发时间：</span></div>
    <div class="travel_time_1"><span style="font-size: 20px;line-height:40px;">${product.productpath}</span></div>
    <div class="travel_time_2"><span style="font-size: 20px;line-height:40px;">途径：</span></div>
    <div class="travel_time_1"><span style="font-size: 20px;line-height:40px;">${product.productgo}</span></div>
    <div class="travel_time_2"><span style="font-size: 20px;line-height:40px;">往返方式：</span></div>
    <div class="travel_time_1"><span style="font-size: 20px;line-height:40px;">${product.touring_party_code}</span></div>
    <div class="travel_time_2"><span style="font-size: 18px;line-height:40px;">旅行团编号：</span></div>
    <div class="travel_time_1"><span style="font-size: 20px;line-height:40px;" id="usercode">${product.usercode}</span></div>
    <div class="travel_time_2"><span style="font-size: 18px;line-height:40px;">商家：</span></div>
    <div class="travel_time_1"><span style="font-size: 20px;line-height:40px;">${product.remain_number}</span></div>
    <div class="travel_time_2"><span style="font-size: 18px;line-height:40px;">剩余名额：</span></div>

    <div class="people_price">

        <div class="c_chose">
        <div class="travel_time_2" style="float: left"><span style="font-size: 18px;line-height:40px;">儿童人数：</span></div>
        <button  style="background-color:#DCDCDC;color:#000000;float: left;height:40px;width: 40px;font-size: 20px;line-height: 1px" id="add01">+</button>
        <input type="text" id="text_box01" style="height: 40px;width: 52px;padding: 1px;align:right;border: 3px solid #000000;font-size:10px;text-align: left;color: #000000;text-align:center;float: left" value="0">
        <button style="background-color:#DCDCDC;color:#000000;float: left;height:40px;width: 40px;font-size: 20px;line-height: 1px" id="minus01">-</button>
            <input id="one_cprice" type="hidden" value="${product.cprice}">
        <div class="c_price" style="float: left;" id="price01">￥<span id="c_price">0</span></div>

        </div>



        <div class="c_chose">
            <div class="travel_time_2" style="float: left"><span style="font-size: 18px;line-height:40px;">成人人数：</span></div>
            <button style="background-color:#DCDCDC;color:#000000;float: left;height:40px;width: 40px;font-size: 20px;line-height: 1px" id="add02">+</button>
            <input type="text" id="text_box02" style="height: 40px;width: 52px;padding: 1px;align:right;border: 3px solid #000000;font-size:10px;text-align: left;color: #000000;text-align:center;float: left" value="0">
            <button style="background-color:#DCDCDC;color:#000000;float: left;height:40px;width: 40px;font-size: 20px;line-height: 1px" id="minus02">-</button>
            <input id="one_aprice" type="hidden" value="${product.aprice}">
            <div class="c_price" style="float: left">￥<span id="a_price">0</span></div>
        </div>

        <div class="buy">
            <div class="all_price">
            <%--<input type="submit" style="float: right;    border:solid 1px #f00;width: 200px;height:50px;background-color: #7ba92c;font-size: 20px" value="立即购买" id="buy">--%>
                <a id="buy" style="float: right;    border:solid 1px #f00;width: 200px;height:50px;background-color: #7ba92c;font-size: 20px;text-align: center;line-height: 50px;color: white" href="${pageContext.request.contextPath }/font/usersOrder">立即购买</a>
            </div>
            <div class="all_price_buy" style="height: 40px;width: 150px;padding: 1px;align:right;border: 3px solid #000000;font-size:10px;text-align: left;color: #000000;text-align:center;float: right;margin-top: 10px;font-size: 20px">
                ￥<span class="all_price" id="all_price">0</span>
            <%--<input type="text" style="height: 40px;width: 150px;padding: 1px;align:right;border: 3px solid #000000;font-size:10px;text-align: left;color: #000000;text-align:center;float: right;margin-top: 10px;font-size: 20px" value="￥150000">--%>
            </div>

        </div>

    </div>


</div>

<div class="produce_details_text">
    <span style="font-size: 20px">${product.productdetils}
    </span>
</div>




<div style="width: 500px;height: 500px;background-color: #ffffff"></div>
</body>
<script type="text/javascript" src="${pageContext.request.contextPath }/js/product_img.js"></script>
</html>
<jsp:include page="/WEB-INF/jsp/foot.jsp"/>